<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Withdraw_deposit extends MY_Controller{
    public function __construct(){
        parent::__construct();
        $this->load->model('withdraw_model','w');
    }

    public function index(){
        $this->data["navigation"] = "w_index";
        $this->data['title'] = '提现记录';

        $this->load->library('pagination');
        $page_no = $this->input->get('per_page')?$this->input->get('per_page'):1;
        $per_page = 20;
        $config['base_url'] = site_url('withdraw_deposit/index');
        $config['total_rows'] = $this->w->get_withdraw_num();
        $config['per_page'] = $per_page;
        $config['num_links'] = 8;
        $config["use_page_numbers"] = true;
        $config['page_query_string'] = TRUE;
        $this->pagination->initialize($config);

        $this->data['withdraw'] = $this->w->get_all_withdraw($per_page,$page_no);
        $this->load->view('withdraw_deposit',$this->data);
    }


    public function record(){
        $this->data["navigation"] = "w_record";
        $this->data['title'] = '充值记录';

        $this->load->library('pagination');
        $page_no = $this->input->get('per_page')?$this->input->get('per_page'):1;
        $per_page = 20;
        $config['base_url'] = site_url('withdraw_deposit/record');
        $config['total_rows'] = $this->w->get_record_num();
        $config['per_page'] = $per_page;
        $config['num_links'] = 8;
        $config["use_page_numbers"] = true;
        $config['page_query_string'] = TRUE;
        $this->pagination->initialize($config);

        $this->data['record'] = $this->w->get_all_record($per_page,$page_no);
        $this->load->view('record',$this->data);
    }
}